home *** CD-ROM | disk | FTP | other *** search
- Path: harden.demon.co.uk!mark
- From: Mark Harden <mark@harden.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Binary Tree and MSC/C++7.00
- Date: Mon, 8 Jan 1996 15:48:38 +0000
- Organization: Not an organisation
- Distribution: world
- Message-ID: <1s+9WFAWzT8wEwN7@harden.demon.co.uk>
- References: <HAKOLA.96Jan7002825@lk-hp-16.hut.fi>
- Reply-To: Mark Harden <mharden@harden.demon.co.uk>
- NNTP-Posting-Host: harden.demon.co.uk
- X-NNTP-Posting-Host: harden.demon.co.uk
- MIME-Version: 1.0
- X-Newsreader: Turnpike Version 1.10 <RMdKwNiDEBO6d87vIffee+0s$n>
-
- In article <HAKOLA.96Jan7002825@lk-hp-16.hut.fi>, Petri Hakola
- <hakola@snakemail.hut.fi> writes
-
- Hi
-
- > if(root == NULL)
- > return;
- > delete_tree(root->left);
- > free(root);
- > delete_tree(root->right);
-
- Swap the last two line you cannot access root after it is freed !
-
- > And then some problems with strings. Is it common that while
- > coding using Microsoft Programmers Workbench, strings aren't
- > what they're supposed to be. For examble, if I use strncat to
- > cut string from 100 char to 45 char, string is cut, but if I
- > print it using printf, first 45 chars come out ok, but rest of
- > the string is filled with smiling faces and all sorts of
- > 'exotic' characters. Like '\0' isn't there or something...
-
- strncat doesn't always append a '\0' character. Do it yourself with
- string [45] = '\0' and read up on strncat.
-
- > Any suggestions are very welcome, I'm quite stuck with these
- > problems of mine.
-
- No problem I hope I helped !
-
- > - Petri -
-
- --
- Mark Harden
-